<?php

namespace mpend\modules\passport\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\passport\models\UnBindMobileForm;

/**
 * 解除帐号绑定信息
 * @author emhome <emhome@163.com>
 * @since 2.0
 */
class UnbindController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * @inheritdoc
     */
    protected function rules() {
        return [
            [
                'actions' => ['mobile'],
                'allow' => true,
                'roles' => ['@'],
            ],
            [
                'allow' => true,
            ]
        ];
    }

    /**
     * 绑定手机号
     * @return mixed
     */
    public function actionMobile() {
        $model = new UnBindMobileForm();
        $model->user_id = $this->uid;
        return $model->unbind();
    }

}
